#include "widget.h"
#include "MyWdigeLayout.h"
#include <QApplication>
#include <QLocale>
#include <QTranslator>
#include <QDebug>

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);

    QTranslator translator;
    const QStringList uiLanguages = QLocale::system().uiLanguages();
    for (const QString &locale : uiLanguages) {
        const QString baseName = "workHandler_" + QLocale(locale).name();
        if (translator.load(":/i18n/" + baseName)) {
            a.installTranslator(&translator);
            break;
        }
    }
    Widget w;
    qInfo() << "init layout ";
    auto myLayout = new MyWdigeLayout(&w);
    myLayout->InitLoadFile();

    myLayout->InitLayout();
    w.resize(1800, 1000); // 设置窗口的默认大小为800x600像素
    w.setWindowTitle("报关部台账统计by郑奇  v1.0.4");
    w.show();
    return a.exec();
}
